<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /* 
        当then.catch和fianlly中没有处理当前promise实例的回调函数,则直接穿透
        */
        const p1= new Promise((resolve, reject) => {
            console.log('请求获取A数据');
            try {
                // throw new Error('请求网络出现问题')
                setTimeout(() => {
                    console.log('A数据获取成功');
                    resolve('成功')
                }, 1000);
            } catch (e) {
                reject(e.message)
            }
        })
        .then(()=>{
            return 1
        })
        .catch(()=>{
            return 2
        })
        // .then(()=>{
        //     return 3
        // })
        console.log('p1',p1);
    </script>
</body>
</html>